<%-- 
    Document   : header
    Created on : 2014-11-26, 20:54:56
    Author     : michal
--%>

<%@page import="fuzzy.hibernate.Uzytkownicy"%>
<% Uzytkownicy user = (Uzytkownicy) session.getAttribute("user"); %>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Fuzzy Bank</title>
        <link rel="stylesheet" href="<%=request.getContextPath()%>/css/mainCSS.css">
        <!--<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>-->
        <script src="<%=request.getContextPath()%>/lib/jquery-1.11.1.min.js"></script>
        <script type="text/javascript" src="http://www.google.com/jsapi"></script>

        <script src="<%=request.getContextPath()%>/script/mainScript.js"></script>
        <script src="<%=request.getContextPath()%>/script/loginScript.js"></script>
        <script src="<%=request.getContextPath()%>/script/clientScript.js"></script>
        <script src="<%=request.getContextPath()%>/script/creditScript.js"></script>
        <script src="<%=request.getContextPath()%>/script/findScript.js"></script>
        <script src="<%=request.getContextPath()%>/script/fuzzyScript.js"></script>
    </head>
    <body>
        <div id="baseDiv">
            <div id="headerDiv" class="div">
                <p class="title">Fuzzy Bank</p><br>

                <p class="subTitle">Easiest way to calculate your credit!</p>
            </div>
            <div id="menuDiv" class="div">
                <p class="title">MENU</p><br>
                <a href="<%=request.getContextPath()%>/mainPage.do" class="menuButton">Home</a><br>
                <!--
                <button class="menuButton" onclick="menuButtonHomeAction()">Home</button>
                <br>
                <button class="menuButton" onclick="menuButtonLoginAction()">Login</button>
                <br>
                -->
                <!--<button class="menuButton" onclick="menuButtonCheckCreditAction()">Credit Check</button>-->
                <a href="<%=request.getContextPath()%>/credit.do?method=enter" class="menuButton">Credit Check</a><br>
                <a href="#"  onclick="menuButtonAboutAction()" class="menuButton">About</a><br>
                <!--<button class="menuButton" onclick="menuButtonAboutAction()">About</button>-->
                
                <hr>
                
                <% if (user != null) { %>
                    <% if (user.getLogin().equals("admin")) { %>
                        Welcome, <b><%= user.getLogin() %></b>!<br>
                        <a href="<%=request.getContextPath()%>/logout.do" class="menuButton">Logout</a><br>
                        <a href="<%=request.getContextPath()%>/client.do?method=list" class="menuButton">Clients</a><br>
                        <a href="<%=request.getContextPath()%>/fuzzy.do?method=list" class="menuButton">Fuzzy parameters</a><br>
                    <% } else if (user.getLogin().equals("konsultant")) { %>
                        Welcome, <b><%= user.getLogin() %></b>!<br>
                        <a href="<%=request.getContextPath()%>/logout.do" class="menuButton">Logout</a><br>
                        <a href="<%=request.getContextPath()%>/client.do?method=list" class="menuButton">Clients</a><br>
                        <a href="<%=request.getContextPath()%>/find.do?method=enter" class="menuButton">Suggest credit</a><br>
                    <% } else { %>
                        Welcome, <b><%= user.getLogin() %></b>!<br>
                        <a href="<%=request.getContextPath()%>/logout.do" class="menuButton">Logout</a><br>
                        <a href="<%=request.getContextPath()%>/credit.do?method=enter" class="menuButton">Check Your Credit</a><br>
               <% }} else { %>
                    <a href="<%=request.getContextPath()%>/login.do" class="menuButton">Login</a><br>
                    <a href="<%=request.getContextPath()%>/client.do?method=manage" class="menuButton">Register</a><br>
                <% } %>
            </div>
            <div id="mainDiv" class="div">